using UnityEngine;

public class ThrowObject : MonoBehaviour
{
    public GameObject _preFab;

    [SerializeField] private GameObject _firePrefab;

    [SerializeField] private GameObject _fireOngroundPrefab;
    public string _name { get; }
    public int _count { get; }

    private void Awake()
    {
        _preFab = GetComponent<GameObject>(); //������ȡ�־��Ե����
        _firePrefab = _preFab.transform.Find("fire").gameObject;
        _fireOngroundPrefab = _preFab.transform.Find("fireOnground").gameObject;
    }

    private void OnEnable()
    {
        _firePrefab.SetActive(true);
        _fireOngroundPrefab.SetActive(false);
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision != null)
        {
            _firePrefab.SetActive(false);
            _fireOngroundPrefab.SetActive(true);
        }
    }
}